using System.Collections;
using System.Collections.Generic;
using PureStateMachine;
using UnityEngine;

// Choose hero
public class TSEnd : PState
{
    public TSEnd(PStateBrain brain) : base(brain)
    {
    }

    private float timeleft = 2.0f;
    public override string Name => "End";

    public override void StateInit()
    {
        ;
    }

    public override void StateStart()
    {
        LevelManager.instance.OnFall();
    }

    public override void StateUpdate()
    {
        // TransferTo("Place");
        timeleft -= Time.deltaTime;
        if(timeleft < 0 )
        {
            LevelManager.instance.GameEnd();
            GameManager.instance.LoadMainMenu();
        }
    }

    public override void StateEnd()
    {
        ;
    }
}
